<%--
  Created by IntelliJ IDEA.
  User: LnDamowang
  Date: 2018-12-12
  Time: 12:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <title>登录</title>

    <meta name="description" content="particles.js is a lightweight JavaScript library for creating particles.">
    <meta name="author" content="Vincent Garreau" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <jsp:include page="${pageContext.request.contextPath}/common/common.jsp"/>
    <link rel="stylesheet" media="screen" href="${pageContext.request.contextPath}/static/css/style.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/reset.css"/>
    <script>
        if(window.top!==window.self){window.top.location=window.location};
    </script>

</head>


<body class="">
<div id="particles-js">
    <div class="login">
        <div class="login-top">
            加油站后台管理登录
        </div>
        <form method="post" id="login" action="${pageContext.request.contextPath}/user/login">
            <div class="login-center clearfix">
                <div class="login-center-img"><img src="${pageContext.request.contextPath}/static/img/name.png"/></div>
                <div class="login-center-input">
                    <input type="text" name="workName" value="" placeholder="请输入您的用户名" onfocus="this.placeholder=''" onblur="this.placeholder='请输入您的用户名'"/>
                    <div class="login-center-input-text">用户名</div>
                </div>
            </div>
            <div class="login-center clearfix">
                <div class="login-center-img"><img src="${pageContext.request.contextPath}/static/img/password.png"/></div>
                <div class="login-center-input">
                    <input type="password" name="upwd" value="" placeholder="请输入您的密码" onfocus="this.placeholder=''" onblur="this.placeholder='请输入您的密码'"/>
                    <div class="login-center-input-text">密码</div>
                </div>
            </div>
            <h3  class="text-center" style="color: red">${error}</h3>
            <div class="login-button" onclick="login()">
                登陆
            </div>
        </form>
    </div>
    <div class="sk-rotating-plane"></div>
</div>
<!-- scripts -->
<script src="${pageContext.request.contextPath}/static/js/particles.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/app.js"></script>
<script type="text/javascript">
    function hasClass(elem, cls) {
        cls = cls || '';
        if (cls.replace(/\s/g, '').length == 0) return false; //当cls没有参数时，返回false
        return new RegExp(' ' + cls + ' ').test(' ' + elem.className + ' ');
    }

    function addClass(ele, cls) {
        if (!hasClass(ele, cls)) {
            ele.className = ele.className == '' ? cls : ele.className + ' ' + cls;
        }
    }

    function removeClass(ele, cls) {
        if (hasClass(ele, cls)) {
            var newClass = ' ' + ele.className.replace(/[\t\r\n]/g, '') + ' ';
            while (newClass.indexOf(' ' + cls + ' ') >= 0) {
                newClass = newClass.replace(' ' + cls + ' ', ' ');
            }
            ele.className = newClass.replace(/^\s+|\s+$/g, '');
        }
    }
    document.querySelector(".login-button").onclick = function(){
        addClass(document.querySelector(".login"), "active")
        setTimeout(function(){
            addClass(document.querySelector(".sk-rotating-plane"), "active")
        //     document.querySelector(".login").style.display = "none"
        },800)
        setTimeout(function(){
            removeClass(document.querySelector(".login"), "active")
            removeClass(document.querySelector(".sk-rotating-plane"), "active")
            // document.querySelector(".login").style.display = "block"
            // alert("登录成功")
            $("#login").submit();
        },1000);

    }
</script>
<%--<div class="signinpanel">--%>
    <%--<div class="row">--%>
        <%--<div class="col-sm-6 col-sm-offset-3">--%>
            <%--<form method="post" action="${pageContext.request.contextPath}/user/login">--%>
                <%--<h4 class="no-margins">登录：</h4>--%>
                <%--<p class="m-t-md">加油站后台管理</p>--%>
                <%--<input type="text" class="form-control uname" placeholder="用户名" name="workName" />--%>
                <%--<input type="password" class="form-control pword m-b" placeholder="密码"  name="upwd"/>--%>
                <%--<a href="#">忘记密码了？</a>--%>
                <%--<button class="btn btn-success btn-block">登录</button>--%>
                <%--<h3  class="text-center" style="color: red">${error}</h3>--%>
            <%--</form>--%>
        <%--</div>--%>
    <%--</div>--%>
<%--</div>--%>
</body>
<script>
</script>
</html>

